<?php

namespace Home\Controller;

use Think\Controller;

class ApiController extends Controller
{
    //检测邮箱是否存在
    public function checkemail()
    {
        $email = I('get.email');
        $user = M('User');
        $result = $user->where("username='%s'", $email)->find();
        if ($result) {
            $data['status'] = 1;
        } else {
            $data['status'] = 0;
        }
        $this->ajaxReturn($data);
    }
}
